﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using InsightAuto.Domain.Core;

namespace InsightAuto.Web.Controllers
{
    public class NewsController : Controller
    {
        private CoreContainer db = new CoreContainer();

        //
        // GET: /News/

        public ActionResult Show(int id)
        {
            var article = db.Articles.SingleOrDefault(a => a.ID == id);
            if (article == null) return HttpNotFound();
            return View(article);
        }

        public ActionResult Category(int id)
        {
            var articles = db.Articles.Where(a => a.Category.ID == id);
            return View(articles);
        }
    }
}
